/**
 * @param {string} s
 * @param {string} goal
 * @return {boolean}
 */
 var rotateString = function(s, goal) {
  if(s == goal) return true;
  if(s.length !== goal.length) return false;
  let l = s.length;
  for(let i=0;i < l; i++) {
      if(goal[i] === s[0] && (s.slice(l - i, l) + s.slice(0, l - i) == goal)) {
          return true;
      }
  }
  return false;
};